/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.nanosl.norg.ent;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Thilina
 */
@Embeddable
public class AddressPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "address_number")
    private String addressNumber;
    @Basic(optional = false)
    @Column(name = "street")
    private String street;
    @Basic(optional = false)
    @Column(name = "city_city")
    private String cityCity;

    public AddressPK() {
    }

    public AddressPK(String addressNumber, String street, String cityCity) {
        this.addressNumber = addressNumber;
        this.street = street;
        this.cityCity = cityCity;
    }

    public String getAddressNumber() {
        return addressNumber;
    }

    public void setAddressNumber(String addressNumber) {
        this.addressNumber = addressNumber;
    }

    public String getStreet() {
        return street;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    public String getCityCity() {
        return cityCity;
    }

    public void setCityCity(String cityCity) {
        this.cityCity = cityCity;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (addressNumber != null ? addressNumber.hashCode() : 0);
        hash += (street != null ? street.hashCode() : 0);
        hash += (cityCity != null ? cityCity.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AddressPK)) {
            return false;
        }
        AddressPK other = (AddressPK) object;
        if ((this.addressNumber == null && other.addressNumber != null) || (this.addressNumber != null && !this.addressNumber.equals(other.addressNumber))) {
            return false;
        }
        if ((this.street == null && other.street != null) || (this.street != null && !this.street.equals(other.street))) {
            return false;
        }
        if ((this.cityCity == null && other.cityCity != null) || (this.cityCity != null && !this.cityCity.equals(other.cityCity))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.nanosl.norg.ent.AddressPK[ addressNumber=" + addressNumber + ", street=" + street + ", cityCity=" + cityCity + " ]";
    }
    
}
